<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
	<title>请假管理</title>
	
	<script>
		$(document).ready(function() {
			$("#vacation-tab").addClass("active");
			
			//聚焦第一个输入框
			$("#start_time").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate({
				errorElement: "span"
			});
		});
	</script>
</head>

<body>
	<h1>管理请假</h1>
	<form id="inputForm" action="${ctx}/vacation/save/${vacation.id}" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${vacation.id}"/>
		<fieldset>
			<legend><small>管理请假</small></legend>
			<div class="control-group">
				<label for="start_time" class="control-label">开始时间:</label>
				<div class="controls">
					<input type="text" id="start_time" name="startTime"  value="${vacation.startTime}" class="input-large required date"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="num_of_day" class="control-label">请假天数:</label>
				<div class="controls">
					<input type="text" id="num_of_day" name="numOfDay"  value="${vacation.numOfDay}" class="input-large required digits"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="reason" class="control-label">请假原因:</label>
				<div class="controls">
					<textarea id="reason" name="reason" class="input-large required" maxlength="500">${vacation.reason}</textarea>
				</div>
			</div>	
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form>
</body>
</html>
